package com.ym.manager.admin.terminal;

import com.ym.datasource.DataSourceType;
import com.ym.datasource.UseDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: dhf
 * @ClassName: AppService
 * @Date: 2022/8/30 12:26
 * @Description:
 * @Version: 1.0
 */
@Service
public class AppService {
    @Autowired
    private AppDao appDao;

    @UseDataSource(DataSourceType.YS_IM)
    public List<Map<String, Object>> getList() {
        return appDao.getList();
    }
    @UseDataSource(DataSourceType.YS_IM)
    public Map<String, Object> appInfo(long id) {
        return appDao.appInfo(id);
    }

    @UseDataSource(DataSourceType.YS_IM)
    public int updateEdit(long id, String version,String app_version, String version_code, int is_forced_updating, String updating_content,String app_url) {
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("app_version",app_version);
        map.put("version_code",version_code);
        map.put("is_forced_updating",is_forced_updating);
        map.put("updating_content",updating_content);
        map.put("app_url",app_url);
        map.put("version",version);
        return appDao.updateEdit(map);


    }
}
